﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace BlackListDataSyn
{
   public class SHA1
    {
       public SHA1()
       {
 
       }
       public static string EncryptToSHA1(string str)
       {
           SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
           byte[] str1 = Encoding.UTF8.GetBytes(str);
           byte[] str2 = sha1.ComputeHash(str1);
           sha1.Clear();
           (sha1 as IDisposable).Dispose();
           return Convert.ToBase64String(str2);
       }
    }
}
